package com.grj.parking.controller;


import com.grj.parking.config.Result;
import com.grj.parking.domain.SysUser;
import com.grj.parking.service.SysUserService;
import lombok.RequiredArgsConstructor;
import org.apache.catalina.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/users")
@RequiredArgsConstructor
public class UsersController {

    private final SysUserService userService;

    @GetMapping
    public Result<String> g(){
        return Result.success("hello world");
    }
    @GetMapping("/hello")
    public Result<String> hello(){
        return Result.success("hello world");
    }

    @PostMapping
    public Result<Boolean> list(SysUser sysUser){
        return Result.success(userService.save( sysUser));
    }

}
